<template>
  <div v-if="dataLst && dataLst.length > 0" class="mt16">
    <InfoItem v-for="item in dataLst" :key="item.id" :dataSource="item" />
  </div>
  <a-empty v-else class="mt16" />
</template>
<script>
import { selectEventByEmpIdReq } from "./api";
import InfoItem from "./components/infoItem";
export default {
  name: "",
  components: { InfoItem },
  mixins: [],
  props: {},
  data() {
    return {
      dataLst: []
    };
  },
  computed: {
    empId() {
      return this.$route.query.id;
    }
  },
  watch: {
    empId: {
      handler() {
        this.loadData();
      },
      immediate: true
    }
  },
  created() {},
  mounted() {},
  methods: {
    loadData() {
      if (this.empId) {
        selectEventByEmpIdReq(this.empId)
          .then((res) => {
            this.dataLst = res.data;
          })
          .catch((err) => {
            console.log(err);
          });
      }
    }
  }
};
</script>
<style lang="scss"></style>
